package main

import (
	"context"
	"google.golang.org/grpc"
	"grpcDemo/proto"
	"log"
	"net"
)

type ProdService1 struct {
}

type ProdService struct{}

func (this *ProdService) GetProduct(ctx context.Context, req *product.ReqProduct) (rsp *product.RespProduct, err error) {
	rsp = &product.RespProduct{Data: "lll"}
	return
}

func main() {
	lis, _ := net.Listen("tcp", ":8080")
	grpcService := grpc.NewServer()
	product.RegisterGetProductServiceServer(grpcService, &ProdService{})
	err := grpcService.Serve(lis)
	if err != nil {
		log.Fatal(err)
	}
}
